import axios from '../../utils/axios';
import api from '../../api';
export function getAllList({ currentPage, pageSize }) {
    return new Promise((resovle, reject) => {
        axios({
            url: api.KnowledgeApi.Knowledge.KNOWLEDGE_ALLLIST,
            params: { currentPage: currentPage, pageSize: pageSize },
            method: 'get'
        }).then((data) => {
            resovle(data)
        }).catch((err) => {
            reject(err)
        })
    })
}

export function getSearchList({ currentPage, pageSize,title }) {
    return new Promise((resovle, reject) => {
        axios({
            url: api.KnowledgeApi.Knowledge.KNOWLEDGE_SEARCH,
            params: { currentPage: currentPage, pageSize: pageSize, title:title },
            method: 'get'
        }).then((data) => {
            resovle(data)
        }).catch((err) => {
            reject(err)
        })
    })
}

export function getSaleIndustryList({ currentPage, pageSize,sort }) {
    return new Promise((resovle, reject) => {
        axios({
            url: api.KnowledgeApi.Knowledge.KNOWLEDGE_SALE_INDUSTRYLIST,
            params: { currentPage, pageSize, sort },
            method: 'get'
        }).then((data) => {
            resovle(data)
        }).catch((err) => {
            reject(err)
        })
    })
}

export function delList({ currentPage, pageSize,k_id }) {
    return new Promise((resovle, reject) => {
        axios({
            url: api.KnowledgeApi.Knowledge.KNOWLEDGE_DELLIST,
            params: { currentPage, pageSize,k_id },
            method: 'post',
        }).then((data) => {
            resovle(data)
        }).catch((err) => {
            reject(err)
        })
    })
}

export function addList({ currentPage, pageSize,sort,title,outline,user_name}) {
    return new Promise((resovle, reject) => {
        axios({
            url: api.KnowledgeApi.Knowledge.KNOWLEDGE_ADDLIST,
            params: { currentPage, pageSize,sort,title,outline,user_name },
            method: 'post',
        }).then((data) => {
            resovle(data)
        }).catch((err) => {
            reject(err)
        })
    })
}